<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Video</title>
    <link href="${ctxPath}/videojs/video-js.min.css" rel="stylesheet"/>
</head>
<body>
<video id="player">
    your browser does not support the video tag
</video>
</body>
</html>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="${ctxPath}/videojs/video.min.js" type="text/javascript"></script>
<script type="text/javascript">

    var player = videojs('player', {
        sources: [{
            src: 'http://127.0.0.1:8080/video/playMp4?fileName=test.mp4',
            type: 'video/mp4'
        }],
        controls: true, //控制条：boolean
        controlBar: {
            playToggle: {
                replay: true
            },
            progressControl: false,
            currentTimeDisplay: true
        }
    }, function onPlayerReady() {
        // 修改this指向
        var vdthis = this;
        console.log('播放器已经准备好了!');

        this.play();

        this.on('ended', function () {
            videojs.log('播放结束了!');
        });
    });
</script>